package org.urchr.beorganized.api.impl;

import org.urchr.beorganized.api.base.PrivateBaseAPIServlet;
import org.urchr.beorganized.dao.NotesDAO;
import org.urchr.beorganized.dao.XMLDocumentBuilder;
import org.urchr.beorganized.dao.errors.GeneralException;

public class StarNote extends PrivateBaseAPIServlet {

	@Override
	protected void doProcessPrivate() throws GeneralException {
		int noteID = NotesDAO.safeInt(request.getParameter("noteid"), -1);
		XMLDocumentBuilder doc = new XMLDocumentBuilder();
		doc.getRootElement("result").setAttribute("added", new Boolean(NotesDAO.starItem(userID, noteID)).toString());
		sendNode(doc.getRootElement());
	}

}
